<template>
  <div>
    <nav>
      <router-link to="/public-activities">公开活动</router-link>
      <router-link v-if="user?.role === 'admin'" to="/activity-management">活动管理</router-link>
    </nav>
    <router-view />
  </div>
</template>

<script>
export default {
  computed: {
    user() {
      return JSON.parse(localStorage.getItem('user'))
    }
  }
}
</script>